#ifndef MYOCL_H
#define MYOCL_H

#include <fstream>
#include <QString>
using namespace std;

class MyOCL abstract
{
private:
	static cl_device_id * createDeviceId();
	static cl_context createContext();
	static cl_command_queue createCommandQueue();

protected:
	static const cl_device_id		*devices;
	static const cl_context			context;
	static const cl_command_queue	commandQueue;

	cl_program program;
	// this program uses only one kernel and this serves as a handle to it 
	cl_kernel kernel;

public:
	// Initialize CL 
	virtual void initializeCL(void) = 0;
	// Initialize Host application 
	virtual void initializeHost(void) = 0;
	// releases OpenCL resources
	void cleanupCL(void);
	// releases program's resources 
	virtual void cleanupHost(void) = 0;
	// run kernel on cl
	virtual void runCLKernels(void) = 0;
	// print error
	static void writeErrorToLog(cl_int status, QString messageError, QString fileError="");
	// convert code from file to string
	string convertToString(const char * filename);
};

#endif MYOCL_H